#include <iostream>

using namespace std;

int singleNumber(int* nums, int numsSize) 
{
    int ret = 0;
    for (int i = 0; i < numsSize; i++)
    {
        ret ^= nums[i];
    }
    
    return ret;
}

int main()
{
	int nums[] = {2,2,1};
	int n = sizeof(nums) / sizeof(nums[0]); 
	int ret = singleNumber(nums, n);
	cout << ret << endl;
	
	return 0;
}
